/**
 * User: Paulo Fournier
 * Date: 12-08-2013
 * Trailer data model
 */

Ext.define('Mobile-app.model.Trailer', {
    extend: 'Ext.data.Model',

    config: {
        autoLoad: false,
        fields: [
            //vehiclesForUserId
            {name: 'id',                type: 'int',        filterable: true},
            {name: 'probeId',           type: 'int',        filterable: true},
            {name: 'licensePlate',      type: 'string',     filterable: true},
            {name: 'state',             type: 'string'},
            {name: 'vehicleId',         type: 'int'},
            {name: 'latitude',          type: 'float'},
            {name: 'longitude',         type: 'float'},
            {name: 'fractal',           type: 'string',     filterable: true},
            {name: 'speed',             type: 'float'},
            {name: 'heading',           type: 'float'},
            {name: 'connectionDate',    type: 'date',   format: 'Y-m-d'},
            {name: 'disconnectionDate', type: 'date',   format: 'Y-m-d'}

        ],
        proxy: {
            type: 'ajax',
            url: 'app/php/public/trailer.request.php',
            reader: {
                type: 'json'
            }
        }
    }

})